<?php

namespace support;

use GuzzleHttp\Client;

class Express
{
    protected $appCode;

    public function __construct($appCode)
    {
        $this->appCode = $appCode;
    }

    public function getList($no)
    {
        $params = http_build_query([
            'no' => $no,
        ]);
        $client = new Client(['base_uri' => 'https://wuliu.market.alicloudapi.com']);
        $response = $client->request('GET', '/kdi?' . $params, [
            'headers' => [
                'Authorization' => 'APPCODE ' . $this->appCode
            ]
        ]);

        return json_decode($response->getBody()->getContents(), true);
    }
}